<template>
    <div class="app-container">
      <el-row :gutter="20">
        <el-col :span="18" :xs="24">
          <el-card>
            <div slot="header" class="clearfix">
              <span>基本资料</span>
            </div>
            <el-tabs v-model="activeTab">
              <el-tab-pane label="基本资料" name="userinfo">
                <userInfo :user="userInfo" />
              </el-tab-pane>
              <el-tab-pane label="修改密码" name="resetPwd">
                <resetPwd />
              </el-tab-pane>
            </el-tabs>
          </el-card>
        </el-col>

      </el-row>
    </div>
</template>

<script>
import { login, logout, getInfo, list } from '@/api/user'
import userInfo from "./userInfo";
import resetPwd from "./resetPwd";
export default {
  name: "Profile",
  // 组件
  components:{ userInfo, resetPwd},
  // 数据
  data() {
    return {
        userInfo: {},
        activeTab: "userinfo"
    }
  },
  // 监听
  watch: {},
  // 构造函数
  created(){
    this.getUserInfo()
  },
  // 函数方法
  methods:{
    getUserInfo() {
      getInfo().then( res => {
        console.log('userInfo', res)
        if(res.success){
            this.userInfo = res.data
        }
      })
    }
  }
}
</script>

<style scoped lang="scss">

</style>
  